package cc.ilzy.mall.api.controller;

import cc.ilzy.mall.model.vo.CouponRecordVO;
import cc.ilzy.mall.utils.ApiResponse;
import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.*;

@Api(value = "优惠券记录接口", tags = "优惠券记录接口")
@RequestMapping("/api/couponRecord/v1")
public interface ICouponRecordController {

    @ApiOperation(value = "领取优惠券记录", notes = "领取优惠券记录")
    @ApiImplicitParams({@ApiImplicitParam(name = "couponId", value = "优惠券ID", required = true, dataType = "Long"),
                        @ApiImplicitParam(name = "category", value = "优惠券分类", required = true,
                                          dataType = "String")})
    @PostMapping("/add")
    ApiResponse<Void> receiveCouponRecord(@RequestParam Long couponId, @RequestParam String category);

    @ApiOperation(value = "查询用户优惠券记录", notes = "根据优惠券ID查询用户的优惠券记录")
    @GetMapping("/queryCouponRecord/{couponId}")
    ApiResponse<CouponRecordVO> queryCouponRecordByCouponId(
            @ApiParam(value = "优惠劵的id") @PathVariable Long couponId);


    @PostMapping("/add/new")
    @ApiOperation(value = "新增优惠券记录", notes = "新增用户的优惠券记录")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "Long"),
            @ApiImplicitParam(name = "username", value = "用户名", required = true, dataType = "String")
    })
    ApiResponse<Void> addCouponRecord(@RequestParam Long userId, @RequestParam String username);
}
